home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / pmake / common.mk < prev    next >
Encoding:
Makefile  |  1989-11-15  |  3.5 KB  |  153 lines

  1. #
  2. #  Makefile for the parallel Make program.
  3. #  Note that this Makefile is formatted for PMake itself, rather than make.
  4. #
  5. # This file is to be included by the makefiles in unix, customs and sprite.
  6. #
  7. # Use "make" and "makefile" to compile it the first time...
  8. #
  9. #  $Id: common.mk,v 1.4 89/11/14 17:11:04 adam Exp $ SPRITE (Berkeley)
  10. #
  11. # No makemake.
  12.  
  13. #
  14. # Path variables:
  15. #     DEST            where pmake should be installed
  16. #    DESTLIB            place to store pmake's canned makefiles
  17. #                (e.g. system.mk -- DEFSYSPATH in config.h)
  18. #    SYSTEM_MK                Actual name for the system makefile. I
  19. #                use system.mk.
  20. #    LIBDIR            where the pmake libraries are stored:
  21. #        SPRITEDIR    where the Sprite->UNIX spriteibility
  22. #                library is located.
  23. #        LSTDIR        location of linked-list library
  24. #        INCLUDE        where the sprite include files are
  25. #
  26. DEST        = /usr/public
  27. DESTLIB        = /usr/public/lib/pmake
  28. SYSTEM_MK    = system.mk
  29.  
  30. LIBDIR        = ../lib
  31. SPRITEDIR    = $(LIBDIR)/sprite
  32. LSTDIR        = $(LIBDIR)/lst
  33. INCLUDE        = $(LIBDIR)/include
  34. MKDIR        = $(LIBDIR)/mk
  35.  
  36. #if make(prof) && !defined(sun)
  37. LISTLIB        = -llst_p
  38. SPRITELIB    = -lsprite_p
  39. #else
  40. LISTLIB        = -llst
  41. SPRITELIB    = -lsprite
  42. #endif
  43.  
  44. #
  45. # FLAG DEFINITIONS -- Flag variables for the various compilers, syntax
  46. # checkers and whatnots
  47. # CCFLAGS are for defining additional flags on the command line...
  48. #
  49. COFLAGS     =
  50. LDFLAGS        = $(.LIBS) 
  51. LNFLAGS        = -b
  52. XCFLAGS        =
  53. CFLAGS        = $(.INCLUDES) $(XCFLAGS)
  54.  
  55. #
  56. # SPECIAL TARGETS AND TRANSFORMATION RULES
  57. # Note that the transformation rules from RCS files to standard ones includes
  58. # the removal of any created .o file as well as the checked-out file.
  59. # If you don't like this, nuke it.
  60. #
  61. .SUFFIXES    : .ln
  62.     
  63.  
  64. .PATH.h        : # Clear out .h path
  65. .PATH.h        : ../src $(LSTDIR) $(INCLUDE)
  66. .PATH.a        : # Clear out .a path
  67. .PATH.a        : $(LSTDIR) 
  68. .PATH.ln    : $(LSTDIR) 
  69. .PATH.c        : ../src
  70.  
  71. .DEFAULT    :
  72.     co $(.TARGET)
  73.  
  74. .c.o        : .EXPORTSAME
  75.     $(CC) $(CFLAGS) -c $(.IMPSRC)
  76.  
  77. #if    !defined(VARS_ONLY)
  78.  
  79. #
  80. # Alter egos you want to support. smake and vmake both do System V
  81. # impersonations, while just make pretends to be Make
  82. #
  83. ALIASES        = make smake vmake
  84.  
  85. #
  86. # SOURCE DEFINITIONS -- All Sources for this program:
  87. #
  88. HDRS        = make.h nonints.h ar.h config.h
  89. OBJS        = arch.o compat.o cond.o dir.o make.o job.o main.o parse.o \
  90.         suff.o targ.o rmt.o str.o var.o
  91. SRCS        = arch.c compat.c cond.c dir.c make.c job.c main.c parse.c \
  92.         suff.c targ.c rmt.c str.c var.c
  93. #ifdef SYSV
  94. OBJS        += utimes.o
  95. SRCS        += utimes.c
  96. #endif SYSV
  97.  
  98. LLIBS        = llib-llst.ln
  99. LIBS        = -llst
  100.  
  101. MAKEFILES    = linksprite.mk po.mk makelib.mk makelint.mk shx.mk \
  102.                   $(SYSTEM_MK)
  103.  
  104. .MAIN        : pmake
  105.  
  106. #
  107. # The actual installation of pmake itself is assumed to be done by the
  108. # including makefile, but we need to set up the aliases and install the canned
  109. # makefiles.
  110. #
  111. install        :: .NOEXPORT
  112.     for i in $(MAKEFILES); do
  113.         install -c -m 444 $(MKDIR)/$i $(DESTLIB)
  114.     done
  115.     for in in $(ALIASES); do
  116.         rm -f $(DEST)/$i
  117.         ln -s pmake $(DEST)/$i
  118.     done
  119.  
  120. nonints        : $(SRCS) .NOTMAIN
  121.     rm -f ../src/nonints.h
  122.     $(LIBDIR)/findni $(.ALLSRC) > /tmp/mni$$
  123.     sed -e 's/(.*)/()/' /tmp/mni$$ > ../src/nonints.h
  124.     chmod 444 ../src/nonints.h
  125.     rm -f /tmp/mni$$
  126.  
  127. clean        :: .NOTMAIN .NOEXPORT
  128.     rm -f $(OBJS)
  129.  
  130.  
  131. tags        : $(HDRS) $(SRCS) .NOTMAIN
  132.     @ctags -u $(.OODATE)
  133.  
  134. lint        :: $(SRCS) $(LLIBS) .NOTMAIN
  135.     lint $(LNFLAGS) $(CFLAGS) $(.ALLSRC) > FLUFF 2>&1
  136.  
  137. co        : $(HDRS) $(SRCS) .NOTMAIN
  138.     @chmod 664 $(.OODATE)
  139.  
  140. ci        : .NOTMAIN
  141.     @ci $(SRCS) $(HDRS) < /dev/tty > /dev/tty 2>&1
  142.  
  143. #endif
  144.  
  145. DEPFILE        ?= Makefile
  146. #include    <makedepend.mk>
  147.  
  148. #ifdef HOST
  149. rdist        : $(HDRS) $(SRCS) .NOTMAIN
  150.     rdist -cyw $(SRCS) $(HDRS) $(LSTDIR) $(WILDDIR) \
  151.         $(HOST):/sprite/src/cmds/pmake
  152. #endif HOST
  153.